# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=depant
pkgver=0.3a
pkgrel=12
pkgdesc='Check network for services with default passwords.'
arch=('any')
url='http://midnightresearch.com/projects/depant/'
license=('GPL')
groups=('blackarch' 'blackarch-cracker')
depends=('python2-ipcalc' 'hydra' 'nmap' 'python2-setuptools')
source=("http://web.archive.org/web/20140531100324/http://midnightresearch.com/local/packages/depant/depant-$pkgver.tgz")
#source=("http://midnightresearch.com/local/packages/depant/depant-$pkgver.tgz")
sha512sums=('d41681ac9a41bfcbb7314f3bbe08018a71869a7f5d04e86d89a109eb36d433e9d18dfcd3b5dff96b2753a55fd24b1a1d6b2f9bca465e5fb082cbf00d76c1b289')

build() {
  cd $pkgname

  python2 setup.py build
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 "build/lib/$pkgname/$pkgname.py" \
    "$pkgdir/usr/share/$pkgname/$pkgname.py"
  install -Dm 644 "build/lib/$pkgname/hydra.py" \
    "$pkgdir/usr/share/$pkgname/hydra.py"
  install -Dm 644 "build/lib/$pkgname/nmap.py" \
    "$pkgdir/usr/share/$pkgname/nmap.py"
  install -Dm 644 README "$pkgdir/usr/share/doc/$pkgname/README"
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cat > "$pkgdir/usr/bin/$pkgname"  << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

